package phone.qyg.com.qyg.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.app.base.tool.BaseActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

import phone.qyg.com.qyg.R;
import phone.qyg.com.qyg.model.Order;

/**
 * 作者：lblbh on 2018/6/5 15:23
 * 邮箱：lanbuhan@163.com
 * 功能：预定场馆成功
 */
@ContentView(R.layout.venue_order_sucess)
public class VenueOrderSucessActivity extends BaseActivity {

    @ViewInject(R.id.back)
    TextView back;

    @ViewInject(R.id.status)
    TextView status;

    @ViewInject(R.id.venue_title)
    TextView venue_title;

    @ViewInject(R.id.venue_reserve)
    TextView venue_reserve;

    @ViewInject(R.id.venue_phone)
    TextView venue_phone;

    @ViewInject(R.id.time_recycler)
    TextView time_recycler;

    Order order;

    @Override
    public void initSucessView() {
        Object obj = getTransModels();
        if(obj instanceof Order){
            order = (Order) obj;
        }
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        if(null == order)return;
        back.setText(setAttributeText(order.venueName));
        status.setText(setAttributeText(order.statusName));
        venue_title.setText(setAttributeText(order.roomName));
        venue_reserve.setText(setAttributeText(order.venueName));
        time_recycler.setText(setAttributeText(order.orderTime));
        venue_phone.setText(setAttributeText(order.mobile));
    }

    @Event(value = {R.id.back})
    private void viewOnClick(View v){
        switch (v.getId()){
            case R.id.back:
                this.finish();
                break;
        }
    }

    @Override
    public void initViewHandler() {}
}
